package com.kylin.domain.payment.aggregate;

import com.kylin.domain.payment.command.AsyncWechatPayCommand;
import com.kylin.domain.payment.command.PaymentNotifyCommand;
import com.kylin.domain.payment.command.PaymentRefundCommand;
import com.kylin.shared.common.FunctionProvider;
import org.axonframework.commandhandling.gateway.CommandGateway;
import org.axonframework.eventhandling.gateway.EventGateway;
import org.axonframework.queryhandling.QueryGateway;
import org.springframework.stereotype.Component;

/**
 * 支付处理类
 * @author Damon S.
 * @version v1.0.1
 * @date 2021年01月03日 19:13
 */
@Component
public class PaymentProvider extends FunctionProvider {

    public PaymentProvider(QueryGateway queryGateway,
                           CommandGateway commandGateway,
                           EventGateway eventGateway) {
        super(queryGateway, commandGateway, eventGateway);
    }

    public void asyncPayment(AsyncWechatPayCommand command) {
        sendCommand(command);
    }

    public void notifyPayment(PaymentNotifyCommand command) {
        sendCommand(command);
    }

    public void refundPayment(PaymentRefundCommand command) {
        sendCommand(command);
    }
}
